/*
 $(document).ready(pageLoad);
        function moveImage()
        {
            $(".photo").animate({width: '-=200px'}, 500); 
            $(".photo").animate({width: '+=200px'}, 500); 
        }
        function pageLoad()
        {
            $(".photo").click(moveImage);
        }
*/	
var rate=10;

var timers =new Array();

var margins = new Array();

var movings = new Array();

function moveLeft(obj) {
	var moving = movings[$(obj).attr("id")];
	var margin = margins[$(obj).attr("id")];
	if (!moving) {
		movings[$(obj).attr("id")] = true;
		margin = 0;
	}
	margin-=10;
	margins[$(obj).attr("id")] = margin;
	$(obj).find("img.wide:first-child").css("margin-left",margin+"px");
	if (margin < -210) {
		clearInterval(timers[$(obj).attr("id")]);
		movings[$(obj).attr("id")] = false;
	}
}

function rollLeft(obj){
	var moving = movings[$(obj).attr("id")];
	if (!moving) {
		clearInterval(timers[$(obj).attr("id")]);
		timers[$(obj).attr("id")] = setInterval(function(){moveLeft(obj);},rate);
	}
}

$().ready(function(){
	$(".roll").mouseover(function(){
		rollLeft(this);	
	});
});


function moveRight(obj) {
	var moving = movings[$(obj).attr("id")];
	var margin = margins[$(obj).attr("id")];
	if (!moving) {
		movings[$(obj).attr("id")] = true;
		margin = -220 ;
	}
	margin+=10;
	margins[$(obj).attr("id")] = margin;
	$(obj).find("img.wide:first-child").css("margin-left",margin+"px");
	if (margin > -10) {
		clearInterval(timers[$(obj).attr("id")]);
		movings[$(obj).attr("id")] = false;
	}
}

function rollRight(obj){
	var moving = movings[$(obj).attr("id")];
	if (!moving) {
		clearInterval(timers[$(obj).attr("id")]);
		timers[$(obj).attr("id")] = setInterval(function(){moveRight(obj);},rate);
	}
}

$().ready(function(){
	$(".roll").mouseout(function(){
		rollRight(this);	
	});
});



$(function(){
    $('#menu_list li.qingxin a')
        .css( {backgroundPosition: "0px 0px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-290px 0px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-150px 0px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px 0px"})
            }})
        })
     });
$(function(){
    $('#menu_list li.news a')
        .css( {backgroundPosition: "0px -34px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-147px -34px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-70px -34px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px -34px"})
            }})
        })
     });
$(function(){
    $('#menu_list li.about a')
        .css( {backgroundPosition: "0px -70px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-148px -70px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-120px -70px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px -70px"})
            }})
        })
     });
$(function(){
    $('#menu_list li.photolive a')
        .css( {backgroundPosition: "0px -108px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-148px -108px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-120px -108px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px -108px"})
            }})
        })
     });
$(function(){
    $('#menu_list li.photoart a')
        .css( {backgroundPosition: "0px -146px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-148px -146px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-120px -146px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px -146px"})
            }})
        })
     });
$(function(){
    $('#menu_list li.photosite a')
        .css( {backgroundPosition: "0px -184px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-148px -184px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-120px -184px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px -184px"})
            }})
        })
     });

$(function(){
    $('#menu_list li.photopc a')
        .css( {backgroundPosition: "0px -220px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-148px -220px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-120px -220px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px -220px"})
            }})
        })
     });

$(function(){
    $('#menu_list li.buy a')
        .css( {backgroundPosition: "0px -258px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-148px -258px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-120px -258px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px -258px"})
            }})
        })
     });



$(function(){
    $('#menu_list li.links a')
        .css( {backgroundPosition: "0px -329px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-148px -329px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-120px -329px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px -329px"})
            }})
        })
     });

$(function(){
    $('#menu_list li.man a')
        .css( {backgroundPosition: "0px -367px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"-148px -367px"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"-120px -367px"}, {duration:100, complete:function(){
                $(this).css({backgroundPosition: "0px -367px"})
            }})
        })
     });






